﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;

namespace Tony
{
	public class Configuration
	{
		public int nNormal;
		public int nDelete;

		public string strQueryConditionStringAll;	// 查询条件中文本字符串查询时查询全部时，文本框的值
		public int nQueryConditionIntAll;		// 查询条件中是整型全部时的值

		/// <summary>
		/// 栏目没有链接地址
		/// </summary>
		public string strNoLink = "无";

		/// <summary>
		/// 前台栏目
		/// </summary>
		public int nWebColumn = 1;		// 前台栏目
		/// <summary>
		/// 后台栏目
		/// </summary>
		public int nAdminColumn = 0;	// 后台栏目
		/// <summary>
		/// 前台和后台的栏目都包括
		/// </summary>
		public int nWebAdminColumn = -1;		// 前台和后台的栏目都包括

		public int nWebLargeColumn = 2;		// 前台需要上传大文件栏目

		/// <summary>
		/// 没有上级栏目
		/// </summary>
		public int nNoFather = 0;		// 没有上级栏目

		/// <summary>
		/// 没有上级栏目
		/// </summary>
		public string strNoFather = "无";

		/// <summary>
		/// 一级栏目
		/// </summary>
		public int nFirstColumn = 1;

		public string[] arrStrColumnType = new string[3];

		/// <summary>
		/// 没有上级单位
		/// </summary>
		public int nDepartment_NoFather = 0;

		/// <summary>
		/// 没有上级单位
		/// </summary>
		public string strDepartment_NoFather = "无";

		/// <summary>
		/// 一级单位
		/// </summary>
		public int nDepartment_FirstGrade = 1;

		/// <summary>
		/// 全部用户组
		/// </summary>
		//public int nAllUserGroup = 0;

		public Configuration()
		{
			nNormal = 1;
			nDelete = 0;

			strQueryConditionStringAll = "";
			nQueryConditionIntAll = -1;

			arrStrColumnType[nAdminColumn] = "后台";
			arrStrColumnType[nWebColumn] = "前台";
			arrStrColumnType[nWebLargeColumn] = "大文件前台";
		}

		////////////////////////////////////////////////////////////////////////////////////////////////////
		//
		/// <summary>
		/// 设置栏目类型下来列表
		/// </summary>
		/// <param name="ddl"></param>
		public virtual void SetColumnTypeDropDownList(DropDownList ddl)
		{
			ddl.Items.Add(new ListItem(arrStrColumnType[nAdminColumn], nAdminColumn.ToString()));
			ddl.Items.Add(new ListItem(arrStrColumnType[nWebColumn], nWebColumn.ToString()));
			ddl.Items.Add(new ListItem(arrStrColumnType[nWebLargeColumn], nWebLargeColumn.ToString()));
		}
		////////////////////////////////////////////////////////////////////////////////////////////////////
	}
}
